--[[    slimui - Copyright (c) 2011 atom0s, All rights reserved.    See Copyright notice in slimui.lua    ]]----[[    Notes:    main.lua shows this object inheriting from Strings however because of the point    in this wrapper, there would be a inclusion issue as strings depends on a list.    Because of this, I have choosen to remove the strings base and just wrap the    stringslist together with the strings object.]]--class 'StringList: Object' { ... };----------------------------------------------------------------------------------
-- func: StringList.__init__
-- desc: Constructor called when this object is first created.
----------------------------------------------------------------------------------
function StringList.__init__( self )    Object.__init__( self );end----------------------------------------------------------------------------------
-- func: StringList:Create
-- desc: Creates a new stringlist object.
----------------------------------------------------------------------------------
function StringList:Create( )    self._object = createStringlist( );    if self._object == nil then        slimui:err( 'StringList:Create - failed to initialize a new object.' );    end    return self;end----------------------------------------------------------------------------------
-- func: StringList:Bind
-- desc: Binds this stringlist object to the given stringlist.
----------------------------------------------------------------------------------function StringList:Bind( list )    if list == nil then        slimui:err( 'StringList:Bind - parent stringlist cannot be nil' );    end    local class = object_getClassName( list );    if string.lower( class ) ~= 'twin32liststringlist' then        slimui:err( 'StringList:Bind - cannot bind to objects that are not a stringlist!' );    end    if self._object ~= nil then        object_destroy( self._object );    end    self._object = list;    return self;end--[[ StringList Properties ]]---------------------------------------------------------------------------------------------------------------------------------------
-- func: StringList:GetDuplicates
-- desc: Returns the duplicates property of this stringlist object.
----------------------------------------------------------------------------------function StringList:GetDuplicates( )    return stringlist_getDuplicates( self._object );end----------------------------------------------------------------------------------
-- func: StringList:SetDuplicates
-- desc: Sets the duplicates property of this stringlist object.
----------------------------------------------------------------------------------function StringList:SetDuplicates( dup )    stringlist_setDuplicates( self._object, dup );end----------------------------------------------------------------------------------
-- func: StringList:GetSorted
-- desc: Returns the sorted property of this stringlist object.
----------------------------------------------------------------------------------function StringList:GetSorted( )    return stringlist_getSorted( self._object );end----------------------------------------------------------------------------------
-- func: StringList:SetSorted
-- desc: Sets the sorted property of this stringlist object.
----------------------------------------------------------------------------------function StringList:SetSorted( sort )    stringlist_setSorted( self._object, sort );end----------------------------------------------------------------------------------
-- func: StringList:GetCaseSensitive
-- desc: Returns the case sensitive property of this stringlist object.
----------------------------------------------------------------------------------function StringList:GetCaseSensitive( )    return stringlist_getCaseSensitive( self._object );end

----------------------------------------------------------------------------------
-- func: StringList:SetCaseSensitive
-- desc: Sets the case sensitive property of this stringlist object.
----------------------------------------------------------------------------------
function StringList:SetCaseSensitive( case )
    stringlist_setCaseSensitive( self._object, case );
end
--[[ Strings Properties ]]-----------------------------------------------------
----------------------------------------------------------------------------------
-- func: StringList:Clear
-- desc: Clears the items from this stringlist object.
----------------------------------------------------------------------------------
function StringList:Clear( )
    strings_clear( self._object );
end

----------------------------------------------------------------------------------
-- func: StringList:Add
-- desc: Adds a new item to this stringlist object.
----------------------------------------------------------------------------------
function StringList:Add( str )
    strings_add( self._object, str );
end

----------------------------------------------------------------------------------
-- func: StringList:Delete
-- desc: Deletes the item at the given index from this stringlist object.
----------------------------------------------------------------------------------
function StringList:Delete( index )
    strings_delete( self._object, index );
end

----------------------------------------------------------------------------------
-- func: StringList:GetText
-- desc: Returns the items of this stringlist object as one big string.
----------------------------------------------------------------------------------
function StringList:GetText( )
    return strings_getText( self._object );
end

----------------------------------------------------------------------------------
-- func: StringList:SetText
-- desc: Sets the text of this stringlist object with one big string.
----------------------------------------------------------------------------------
function StringList:SetText( str )
    strings_setText( self._object, str );
end

----------------------------------------------------------------------------------
-- func: StringList:IndexOf
-- desc: Returns the index of the given string from this stringlist object.
----------------------------------------------------------------------------------
function StringList:IndexOf( str )
    return strings_indexOf( self._object, str );
end

----------------------------------------------------------------------------------
-- func: StringList:Insert
-- desc: Inserts the given string into the location given in this stringlist object.
----------------------------------------------------------------------------------
function StringList:Insert( index, str )
    strings_insert( self._object, index, str );
end

----------------------------------------------------------------------------------
-- func: StringList:GetCount
-- desc: Returns the number of strings in this stringlist object.
----------------------------------------------------------------------------------
function StringList:GetCount( )
    return strings_getCount( self._object );
end

----------------------------------------------------------------------------------
-- func: StringList:Remove
-- desc: Removes the given string from this stringlist object.
----------------------------------------------------------------------------------
function StringList:Remove( str )
    strings_remove( self._object, str );
end

----------------------------------------------------------------------------------
-- func: StringList:LoadFromFile
-- desc: Loads a list of strings from the given file into this stringlist object.
----------------------------------------------------------------------------------
function StringList:LoadFromFile( filename )
    strings_loadFromFile( self._object, filename );
end

----------------------------------------------------------------------------------
-- func: StringList:SaveToFile
-- desc: Saves this stringlist objects items to the given file.
----------------------------------------------------------------------------------
function StringList:SaveToFile( filename )
    strings_saveToFile( self._object, filename );
end

----------------------------------------------------------------------------------
-- func: StringList:GetString
-- desc: Returns the string from this stringlist object at the given index.
----------------------------------------------------------------------------------
function StringList:GetString( index )
    return strings_getString( self._object, index );
end

----------------------------------------------------------------------------------
-- func: StringList:SetString
-- desc: Sets the string at the given index in this stringlist object.
----------------------------------------------------------------------------------
function StringList:SetString( index, str )
    strings_setString( self._object, index, str );
end




--[[ Debug information. ]]--------------------------------------------------------
if ( slimui:isdebug() == true ) then
    slimui:msg( '(Base) stringlist.lua successfully loaded.' );
end